package com.sofwin.controller;

import com.github.pagehelper.PageInfo;
import com.sofwin.Constants;
import com.sofwin.pojo.CInformation;
import com.sofwin.pojo.CInformationWithBLOBs;
import com.sofwin.service.CompanyListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

/**
 * @program: authority-management-system.git
 * @description: TODO
 * @author: Mr.Gao
 * @create: 2021-04-24 09:25
 **/
@Controller
@RequestMapping("companyList")
public class CompanyListController {

    @Autowired
    private CompanyListService companyListService;




    /**
    * @Description: 详情
    * @param cInformation: 实体类
     * @param pageNumber: 当前页码
     * @param pageSize: 每页显示的条数
     * @param model: 作用域
    * @return: String
    * @Author: Mr.Gao
    * @Date: 2021/4/24
    */
    @RequestMapping(value = "data",method = RequestMethod.GET)
    public String data( CInformation cInformation, @RequestParam(required = true,defaultValue = "1") Integer pageNumber,
                       @RequestParam(required = true,defaultValue = Constants.DEFAULT_PAGE_SIZE) Integer pageSize, Model model){
        PageInfo<CInformation> page = companyListService.selectCompanyListByPage(cInformation,pageNumber,pageSize);
        model.addAttribute("data",page.getList());
        model.addAttribute("page",page);
        model.addAttribute("user",cInformation);
        return "c_information/companyList";
    }

}
